<p class="text-right doc-link">Table <a target="_blank" ng-href="{{ wikiLink }}loot_template"><span class="glyphicon glyphicon-link" aria-hidden="true"></span>creature_loot_template</a></p>
<br>
<div class="row">
  <div class="col-xs-4">
    <div class="row">
      <div class="col-xs-4">
        <small>Item</small>
        <div class="input-group">
          <input class="form-control input-xs" type="text" ng-model="selected.Item">
          <div class="input-group-btn">
            <button class="btn btn-info input-xs" ng-click="openSearchModal(selected, 'Item', 'item')">...</button>
          </div>
        </div>
      </div>
      <div class="col-xs-4">
        <small>Reference</small>
        <input class="form-control input-xs" type="text" ng-model="selected.Reference">
      </div>
      <div class="col-xs-4">
        <small>Chance</small>
        <input class="form-control input-xs" type="text" ng-model="selected.Chance">
      </div>
    </div>
  </div>
  <div class="col-xs-4">
    <div class="row">
      <div class="col-xs-4">
        <small>QuestRequired</small>
        <input class="form-control input-xs" type="text" ng-model="selected.QuestRequired">
      </div>
      <div class="col-xs-4">
        <small>LootMode</small>
        <div class="input-group">
          <input class="form-control input-xs" type="text" ng-model="selected.LootMode">
          <div class="input-group-btn">
            <button class="btn btn-info input-xs" ng-click="openFlagModal('partials/creature/modals/loot-mode.html', selected, 'LootMode', 5)">...</button>
          </div>
        </div>
      </div>
      <div class="col-xs-4">
        <small>GroupId</small>
        <input class="form-control input-xs" type="text" ng-model="selected.GroupId">
      </div>
    </div>
  </div>
  <div class="col-xs-4">
    <div class="row">
      <div class="col-xs-4">
        <small>MinCount</small>
        <input class="form-control input-xs" type="text" ng-model="selected.MinCount">
      </div>
      <div class="col-xs-4">
        <small>MaxCount</small>
        <input class="form-control input-xs" type="text" ng-model="selected.MaxCount">
      </div>
      <div class="col-xs-4">
        <small>Comment</small>
        <input class="form-control input-xs" type="text" ng-model="selected.Comment">
      </div>
    </div>
  </div>
</div>
<div class="row">
  <div class="col-xs-4">
    <br>
    <button class="btn btn-primary" ng-click="editSelectedRowOf(new_creature_loot_template, 'Item')"><i class="glyphicon glyphicon-refresh"></i> Edit</button>
    <button class="btn btn-danger" ng-click="deleteSelectedRowFrom(new_creature_loot_template)"><i class="glyphicon glyphicon-remove"></i> Delete</button>
    <button class="btn btn-success" ng-click="addRowTo(new_creature_loot_template, 'Item')"><i class="glyphicon glyphicon-plus"></i> Add new</button>
  </div>
  <div class="col-xs-2 pull-right">
    <br>
    <button class="btn btn-primary pull-right" ng-click="openFullScriptModal(new_creature_loot_template, 'creature_loot_template', 'Entry')">FULL Loot Script</button>
  </div>
  <div class="col-xs-2 pull-right">
    <br>
    <button class="btn btn-success pull-right" ng-click="openDiffScriptModal('creature_loot_template', 'Entry', 'Item', current_creature_loot_template, new_creature_loot_template)">DIFF Loot Script</button>
  </div>
</div>
<div class="row">
  <div class="col-xs-12">
    <br>
    <table class="table table-striped table-condensed">
      <thead>
        <th class="text-center"></th>
        <th class="text-center">Item</th>
        <th class="text-center">Reference</th>
        <th class="text-center">Chance</th>
        <th class="text-center">QuestRequired</th>
        <th class="text-center">LootMode</th>
        <th class="text-center">GroupId</th>
        <th class="text-center">MinCount</th>
        <th class="text-center">MaxCount</th>
        <th class="text-center">Comment</th>
      </thead>
      <tr ng-repeat="loot in new_creature_loot_template track by $index" ng-click="selectRow(new_creature_loot_template, $index)" ng-class="{'tr-selected': $index == selectedRow}" id="{{ $index }}">
        <td><i class="glyphicon glyphicon-edit pointer" ng-click="selectRow(new_creature_loot_template, $index)"></i></td>
        <td><a ng-href="#/item/{{loot.Item}}">{{ loot.Reference == 0 ? loot.Item : "" }}</a>{{ loot.Reference != 0 ? loot.Item : "" }}</td>
        <td>{{ loot.Reference }}</td>
        <td>{{ loot.Chance }}</td>
        <td>{{ loot.QuestRequired }}</td>
        <td>{{ loot.LootMode }}</td>
        <td>{{ loot.GroupId }}</td>
        <td>{{ loot.MinCount }}</td>
        <td>{{ loot.MaxCount }}</td>
        <td>{{ loot.Comment }}</td>
      </tr>
    </table>
  </div>
</div>
